package com.kilon.workfaq.service.write.impl;

import com.kilon.workfaq.entity.FilesmessagePo;
import com.kilon.workfaq.mapper.write.FilesmessageWriteMapper;
import com.kilon.workfaq.service.write.FilesmessageWriteService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Filesmessage)表服务实现类
 *
 * @author makejava
 * @since 2023-03-07 18:49:50
 */
@Service("filesmessageWriteService")
public class FilesmessageWriteServiceImpl implements FilesmessageWriteService {
    @Resource
    private FilesmessageWriteMapper filesmessageWriteMapper;

    /**
     * 新增数据
     *
     * @param filesmessage 实例对象
     * @return 实例对象
     */
    @Override
    public FilesmessagePo insert(FilesmessagePo filesmessage) {
        this.filesmessageWriteMapper.insert(filesmessage);
        return filesmessage;
    }

    /**
     * 修改数据
     *
     * @param filesmessage 实例对象
     * @return 实例对象
     */
    @Override
    public boolean update(FilesmessagePo filesmessage) {
        return this.filesmessageWriteMapper.update(filesmessage) == 1;
    }

    /**
     * 通过主键删除数据
     *
     * @return 是否成功
     */
    @Override
    public boolean deleteById(FilesmessagePo filesmessage) {
        return this.filesmessageWriteMapper.deleteById(filesmessage.getFileid()) == 1;
    }
}
